{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import yaml\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "import tensorflow as tf\n",
    "\n",
    "from tensorflow_tts.configs import MultiBandMelGANGeneratorConfig\n",
    "\n",
    "from tensorflow_tts.models import TFMelGANGenerator\n",
    "from tensorflow_tts.models import TFPQMF"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open('../examples/multiband_melgan/conf/multiband_melgan.v1.yaml') as f:\n",
    "    config = yaml.load(f, Loader=yaml.Loader)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "config = MultiBandMelGANGeneratorConfig(**config[\"generator_params\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "class TFMBMelGANGenerator(TFMelGANGenerator):\n",
    "    def __init__(self, config, **kwargs):\n",
    "        super().__init__(config, **kwargs)\n",
    "        self.pqmf = TFPQMF(config=config, name='pqmf')\n",
    "        \n",
    "    def build(self, input_shape):\n",
    "        self.pqmf.build(input_shape)\n",
    "        self.built = True\n",
    "    \n",
    "    @tf.function(input_signature=[tf.TensorSpec(shape=[None, None, 80], dtype=tf.float32)])\n",
    "    def call(self, mels):\n",
    "        mb_audios = super().call(mels)\n",
    "        audios = self.pqmf.synthesis(mb_audios)\n",
    "        return audios"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "mb_melgan = TFMBMelGANGenerator(config, name=\"mb_melgan\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "fake_mels = tf.random.uniform(shape=[4, 256, 80], dtype=tf.float32)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "audios = mb_melgan(fake_mels)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Model: \"mb_melgan\"\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "sequential (Sequential)      multiple                  2534356   \n",
      "_________________________________________________________________\n",
      "pqmf (TFPQMF)                multiple                  0         \n",
      "=================================================================\n",
      "Total params: 2,534,356\n",
      "Trainable params: 2,534,356\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "mb_melgan.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "mb_melgan.load_weights(\"./generator-940000.h5\", by_name=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Save to Pb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From /home/lap13548/anaconda3/envs/tensorflow-tts/lib/python3.7/site-packages/tensorflow/python/ops/resource_variable_ops.py:1817: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "If using Keras pass *_constraint arguments to layers.\n",
      "INFO:tensorflow:Assets written to: ./mb_melgan/assets\n"
     ]
    }
   ],
   "source": [
    "tf.saved_model.save(mb_melgan, \"./mb_melgan\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Load and Inference"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "mb_melgan = tf.saved_model.load(\"./mb_melgan\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "mels = np.load(\"../dump/valid/norm-feats/LJ001-0009-norm-feats.npy\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "audios = mb_melgan(mels[None, ...])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7f5470403a90>]"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD4CAYAAADvsV2wAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO2deXwV1dnHf08CYd8JiCyGHRFRMAIuIPumora2dekrbqV9rbWtVt+4Ie5arNoW3KpWsFXBrWBB2QVFtiAgayTsYUvYAwFC4Lx/3LlhcjNzZzuz3Xm+n08+mTv33DnPnTvzzDnPeRYSQoBhGIZJfdL8FoBhGIbxBlb4DMMwEYEVPsMwTERghc8wDBMRWOEzDMNEhCp+C6BH48aNRVZWlt9iMAzDhIrly5fvE0Jkar0XWIWflZWF3Nxcv8VgGIYJFUS0Te89NukwDMNEBFb4DMMwEYEVPsMwTERghc8wDBMRWOEzDMNEBFb4DMMwEYEVPsMwTERghW+DeXmFKDhY4rcYDMMwlmCFb4M7/rkMQ1/9xm8xGIZhLMEK3yZHT5b5LQLDMIwlWOEzDMNEBFb4Djhx6rTfIjAMw5iGFb4Dvt920G8RGIZhTMMK3wGvzt7otwgMwzCmYYXvgCMnTvktAsMwjGlY4TOhYs3Ow/guf5/fYjBMKAlsAZSgIoTwW4RIc83fvwUAbH3hap8lYZjwwSN8iyzbygu1DMOEE1b4FjlWygFXDMOEE1b4FpmfV+S3CAzDMLZghW+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XrwxZENBTA/wEYIYQoUe3PJKJ0ZbsNYud2s03Z9L6/E7m9uCbU3+dGAHPjD8RA4PUqsdt/iK3u/4jY6OJRH/q/ErEp3A8AVip/wwG8D2C1sn8qgGaqzzyqyJsHleeK3ndBzGtgKWKLSx8DqCZB7jaIeSGsArA23h9i9sc5ADYq/xsq+wnAeEW21QCyVce6U5EtH8Adqv3ZiN1kmwCMgxLpLUH2mgD2A6in2he4843YA2k3gFOIjQTv8uL86vXhQOZ8xOzU8es77pXyU+XaWQXgewDX2pUt2fd3ILfr1wSA6srrfOX9Nm7qG6t/nFqBYRgmIqSaSYdhGIbRgRU+wzBMRGCFzzAMExFY4TMMw0QEVvgMwzARgRU+wzBMRGCFzzAMExH+H3bdmqyLeJOBAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(audios[0, :, 0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
